package com.demo.travel.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.demo.travel.R;
import com.demo.travel.activity.LoginActivity;
import com.demo.travel.base.BaseFragment;
import com.demo.travel.utils.Config;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Create time 2021/6/15 9:40
 * 我
 */
public class MineFragment extends BaseFragment {

    @BindView(R.id.name_tv)
    TextView nameTv;

    @Override
    public int getLayout() {
        return R.layout.fragment_mine;
    }

    @Override
    public void initData() {
        nameTv.setText(Config.userBean.getUsername());
    }

    @Override
    public String getTitle() {
        return "我";
    }

    @Override
    public void requestData() {

    }

    @OnClick({R.id.layout3,R.id.layout4})
    public void onClick(View view){
        switch (view.getId()) {
            case R.id.layout3:
                showToast("已是最新版本！");
                break;
            case R.id.layout4:
                getActivity().finish();
                Intent intent = new Intent(getActivity(), LoginActivity.class);
                getActivity().startActivity(intent);
                break;
        }
    }

}
